import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import axios from 'axios'
import 'view-design/dist/styles/iview.css'
import { Loading, Icon, Table, TableColumn, Message } from 'element-ui'

Vue.use(Table)
Vue.use(TableColumn)
Vue.use(Loading.directive)
Vue.use(Icon)
Vue.prototype.$message = Message
// 添加响应拦截器
axios.interceptors.response.use(function (response) {
  return response
})

// 添加请求拦截器
axios.interceptors.request.use(function (config) {
  config.headers.uniacid = 5
  return config
}, function (error) {
  // 对请求错误做些什么
  return Promise.reject(error)
})


// router.beforeEach((to, from , next) => {
//   if (to.meta.title) {
//     document.title = to.meta.title
//   }
//   next();
// })


Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
